<?php

namespace App\Http\Controllers\Admin\PayAndConsume;

use App\Http\Controllers\Admin\BaseController;
use App\Http\Requests\Admin\PayAndConsume\HotspotIndexRequest;
use App\Services\PayAndConsume\HotspotService;
use App\Services\Config\ChannelsService;
use Illuminate\Http\Request;

class HotspotController extends BaseController
{

    public function __construct(HotspotService $hotspotService, ChannelsService $channelsService)
    {
        $this->hotspotService = $hotspotService;
        $this->channelsService = $channelsService;
    }

    /**
     * 上传热点数据
     */
    public function index(HotspotIndexRequest $request)
    {
        $reqStartTime = $request->start_time;
        $reqEndTime = $request->end_time;
        $reqDataType = $request->data_type;
        $hotspot = $this->hotspotService->getHotspotData($request);
        $channels = $this->channelsService->getCurGameChannels();

        return view('pay_and_consume.hotspot.index', compact(['hotspot', 'reqStartTime', 'reqEndTime', 'reqDataType', 'channels']));
    }
}
